set more off      
capture log close 

//  do-file: Matanock_Lichtenheld_Replication_Main.do  (to replicate the matching findings, use the R file in the "Matching Analysis" folder)      
//  project: "HOW DOES INTERNATIONAL INTERVENTION HELP SECURE PEACE SETTLEMENTS AFTER CIVIL CONFLICTS?"
//  author:  Aila Matanock & Adam Lichtenheld   
//  date: 1 AUGUST 2021

********************
***MAIN ANALYSIS****
********************

**TABLE 1**
use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
tab force nfc if UN==1, column miss chi2 exact

**TABLE 2**
use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if nonfc == 1 & UN == 1
tab d UN, column miss chi2 exact

use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if nfc == 1 & UN == 1
tab d UN, column miss chi2 exact

use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if noforce == 1 & UN == 1
tab d UN, column miss chi2 exact

use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if force == 1 & UN == 1
tab d UN, column miss chi2 exact

**TABLE 3**
use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if forcenfc ==0 &  UN ==1
tab d forcenfc, column miss chi2 exact

use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if noforcenfc ==0 &  UN ==1
tab d noforcenfc, column miss chi2 exact

use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if forcenonfc ==0 &  UN ==1
tab d forcenonfc, column miss chi2 exact

use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if noforcenonfc ==0 &  UN ==1
tab d noforcenonfc, column miss chi2 exact

**TABLE 4**

*UNMATCHED DATA
use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _t0 t0
rename _t t
rename _d d
stset t, failure(d)

stcox force nfc lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 eeurop asia lamerica ssafrica nafrme tperiod miltnum
stcox noforce nfc lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 eeurop asia lamerica ssafrica nafrme tperiod miltnum
stcox nfc force lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 miltnum      
stcox nonfc force lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 miltnum eeurop asia lamerica ssafrica nafrme 

*MATCHED DATA (use .dta files in "Matching Analysis" folder)

*Military Coercion
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_FORCE.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox force nfc lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 eeurop asia lamerica ssafrica nafrme tperiod miltnum

use "LM_Intervention_Replication/Matching Analysis/peace_post_match_FORCE2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox force nfc lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 miltnum ethnicwar terr marxist 

*No Military Coercion
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NOFORCE.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox noforce nfc lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 eeurop asia lamerica ssafrica nafrme tperiod miltnum

use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NOFORCE2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox noforce nfc lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 miltnum ethnicwar terr marxist 

*Conditional Incentives (CI)
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NFC.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox nfc force lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 miltnum      

use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NFC2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox nfc force lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 miltnum ethnicwar terr marxist 

*No CI
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NONFC.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox nonfc force lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 miltnum eeurop asia lamerica ssafrica nafrme 

use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NONFC2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox nonfc force lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 ethnicwar terr marxist 

**TABLE 5**

*UNMATCHED DATA
use "LM_Intervention_Replication/ML_peaceperiods_pre-match.dta", clear
 
rename _t0 t0
rename _t t
rename _d d
stset t, failure(d)
stcox forcenfc noforcenfc forcenonfc noforcenonfc 

*MATCHED DATA (use .dta files in "Matching Analysis" folder)

* CI, Coercion
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NFCforce.dta", clear
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NFCforce2.dta", 

rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox UN 
clear

*  CI, No Coercion
use "LM_Intervention_Replication/Matching Analysis//peace_post_match_NFCnoforce.dta", 
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NFCnoforce2.dta", 

rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox UN 

*  No CI, Coercion
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NONFCforce.dta", 
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NONFCforce2.dta", 

rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox UN 

*  No CI, No Coercion
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NONFCnoforce.dta", 
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NONFCnoforce2.dta", 

rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox UN 

****************************
*******APPENDICES************* 
****************************

***Appendix 1.1: ALL UN MISSION DATA, BY MISSION TYPE***
use "LM_Intervention_Replication/ML_missiondata.dta"
tab force pagree, column miss chi2 exact

***Appendix 1.2: BY TIME PERIOD***
use "LM_Intervention_Replication/ML_missiondata.dta"
tab force tperiod if pagree == 1, column miss chi2 exact
tab nfc tperiod if pagree == 1, column miss chi2 exact
tabstat avgtroops avguntotal avgtotal trooppop totpop untotpop if pagree == 1, by(tperiod) stat(n mean p50 sd) long format

***Appendix 1.3: BY MISSIONS SIZE
use "LM_Intervention_Replication/ML_missiondata.dta"
tabstat avgtroops avguntotal avgtotal trooppop totpop untotpop, by(force) stat(n mean p50 sd) long format
tabstat avgtroops avguntotal avgtotal trooppop totpop untotpop, by(nfc) stat(n mean p50 sd) long format
tabstat avgtroops avguntotal avgtotal trooppop totpop untotpop, by(pagree) stat(n mean p50 sd) long format

graph box avgtroops avguntotal avgtotal, over(force) ytitle(Average number of personnel (monthly)) scheme(s2mono)
graph box avgtroops avguntotal avgtotal, over(nfc) ytitle(Average number of personnel (monthly)) scheme(s2mono)

***Appendix 1.4: D&S AND FORTNA'S CHAPTER VI AND CHAPTER VII CODING
use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
tab unc7 nfc if UN==1, column chi2 exact
tab ds_enforce nfc if UN==1, column miss chi2 exact

***Appendix 1.5: COMBINATION OF DIFFERENT PKO TYPES***
use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if forcenfc2 ==0 &  UN ==1
tab d forcenfc2, column miss chi2 exact

use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if noforcenfc2 ==0 &  UN ==1
tab d noforcenfc2, column miss chi2 exact

use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if forcenonfc2 ==0 &  UN ==1
tab d forcenonfc2, column chi2 exact

use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if noforcenonfc2 ==0 &  UN ==1
tab d noforcenonfc2, column miss chi2 exact

use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if forcenfc3 ==0 &  UN ==1
tab d forcenfc3, column miss chi2 exact

use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if noforcenfc3 ==0 &  UN ==1
tab d noforcenfc3, column miss chi2 exact

use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if forcenonfc3 ==0 &  UN ==1
tab d forcenonfc3, column chi2 exact

use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
rename _d d
drop if noforcenonfc3 ==0 &  UN ==1
tab d noforcenonfc3, column miss chi2 exact

*Appendix 1.6: BALANCE TESTS/SELECTION MODELS

*Appendix 1.6A. Selection Models
use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear

*ANY UN*
eststo clear
foreach var of varlist lwdeaths - outcome_dum {
eststo: logit UN `var'
}
esttab using selectionUN1.csv, replace
esttab using selectionUN2.csv, replace wide plain

*2nd set of models
eststo clear
eststo: quietly logit UN lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2  eeurop lamerica asia ssafrica nafrme tperiod pa  
esttab using selectionUN3.csv, replace

*3rd set of models
eststo clear
foreach var of varlist lwdeaths - outcome_dum {
eststo: quietly logit UN `var' lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 
}
esttab using selectionUN4.csv, replace

*COERCION*
eststo clear
foreach var of varlist lwdeaths - outcome_dum {
eststo: quietly logit force `var'
}
esttab using selectionFORCE1.csv, replace

*2nd set
eststo clear
eststo: quietly logit force lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 eeurop lamerica asia ssafrica nafrme tperiod pa  
esttab using selectionFORCE3.csv, replace

*3rd set
eststo clear
foreach var of varlist lwdeaths - outcome_dum {
eststo: quietly logit force `var' lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 
}
esttab using selectionFORCE4.csv, replace

*CI*
eststo clear
foreach var of varlist lwdeaths - outcome_dum {
eststo: quietly logit nfc `var'
}
esttab using selectionNFC1.csv

*2nd set
eststo clear
eststo: quietly logit nfc lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2  eeurop lamerica asia ssafrica nafrme tperiod pa
esttab using selectionNFC2.csv

*3rd set
eststo clear
foreach var of varlist lwdeaths - outcome_dum {
eststo: quietly logit nfc `var' lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 
}
esttab using selectionNFC3.csv, replace

*4th set of models
eststo clear
foreach var of varlist lwdeaths - outcome_dum {
eststo: mlogit PKOtype `var' 
}
esttab using selectionMULTI5.csv, replace 
esttab using selectionMULTI6.csv, replace wide plain

*5th set of models - comparing CI-only and coercive-only missions
use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
keep if noforcenfc == 1 | forcenonfc == 1

eststo clear
foreach var of varlist lwdeaths - outcome_dum {
eststo: mlogit forcenonfc `var' 
}
esttab using selectionmodels7.csv, replace 

*Appendix 1.6B. BALANCE TESTS
use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
drop if UN == 0

eststo clear
foreach var of varlist lwdeaths - outcome_dum {
ttest `var', by(force) unpaired
ksmirnov `var', by(force)
}
foreach var of varlist lwdeaths - outcome_dum{
ttest `var', by(nfc) unpaired
ksmirnov `var', by(nfc)
}

use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
keep if noforcenfc == 1 | forcenonfc == 1

foreach var of varlist lwdeaths - outcome_dum {
ttest `var', by(noforcenfc) unpaired 
ksmirnov `var', by(noforcenfc)
}

ttest ethnicwar, by(noforcenfc) unpaired 
ksmirnov otherpk_coer, by(noforcenfc)

**Appendix 1.7: Unmatched Data**
*Set of Models 1
use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear

rename _t0 t0
rename _t t
rename _d d
stset t, failure(d)

eststo clear
stcox UN lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 eeurop lamerica asia ssafrica nafrme pa   
stcox nfc nonfc force lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 eeurop lamerica asia ssafrica nafrme tperiod pa
stcox force noforce nfc lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 eeurop lamerica asia ssafrica nafrme tperiod pa 

*Set of Models 2
stcox UN ethnicwar terr marxist pkoduring otherpk pastpk gof elections_mn 
stcox UN ethnicwar terr marxist pkoduring otherpk otherpk_coer gof elections_mn 
stcox force noforce nfc ethnicwar terr marxist pkoduring otherpk pastpk gof elections_mn
stcox force noforce nfc ethnicwar terr marxist pkoduring otherpk_coer pastpk gof elections_mn
stcox nfc nonfc force ethnicwar terr marxist pkoduring otherpk pastpk gof elections_mn 

*Set of Models 3 (3a, 3b, 3c: Compare CI-only and coercive-only missions
keep if noforcenfc == 1 | forcenonfc == 1

eststo clear
stcox noforcenfc
stcox noforcenfc lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2     
stcox noforcenfc ethnicwar terr marxist pkoduring otherpk otherpk_coer gof elections_mn 

**Appendix 1.9: 1.9 Effect of U.N. Peacekeeping on Conflict Recurrence, Additional Models

*1.9A: Any UN (Table 4)*
cd "/Users/alichtenheld/Dropbox/PKO Research/"

use "LM_Intervention_Replication/Matching Analysis/peace_post_match_ANYUN.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox UN lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 eeurop asia lamerica ssafrica nafrme tperiod miltnum

use "LM_Intervention_Replication/Matching Analysis/peace_post_match_ANYUN2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox UN lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 miltnum ethnicwar terr marxist 

*1.9B: Logistic Regression on Combination of PKO Types (Alternative Specification for Table 5)*
* CI, Coercion
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NFCforce.dta", clear
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NFCforce2.dta", clear
logit X_d UN 

*  CI, No Coercion
use "LM_Intervention_Replication/Matching Analysis//peace_post_match_NFCnoforce.dta", clear
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NFCnoforce2.dta", clear
logit X_d UN 

*  No CI, Coercion
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NONFCforce.dta", clear
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NONFCforce2.dta", clear
logit X_d UN 

*  No CI, No Coercion
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NONFCnoforce.dta", clear
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NONFCnoforce2.dta", clear
logit X_d UN 

*1.9C: CI-only missions compared to coercive-only missions (matched data)
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_CICOER.dta", clear
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_CICOER2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox nfc

**Appendix 2.0: ROBUSTNESS CHECKS**

*2.0A
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NFC.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)

eststo clear
eststo: quietly stcox nfc force pkoduring otherpk pastpk gof elections_mn 
eststo: quietly stcox nfc force pkoduring otherpk pastpk gof elections_nelda
esttab using rob1.csv

use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NFC2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)

eststo clear
eststo: quietly stcox nfc force pkoduring otherpk pastpk gof elections_mn 
eststo: quietly stcox nfc force pkoduring otherpk pastpk gof elections_nelda 
esttab using rob2.csv
clear

use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NONFC.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)

stcox UN pkoduring otherpk_coer pastpk gof elections_mn 
stcox nfc noforce pkoduring otherpk_coer pastpk gof elections_nelda
esttab using rob3.csv 

use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NONFC2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)

stcox nonfc force pkoduring otherpk pastpk gof  
stcox nonfc force pkoduring otherpk pastpk gof elections_nelda 
esttab using rob4.csv 

use "LM_Intervention_Replication/Matching Analysis/peace_post_match_FORCE.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)

eststo clear
stcox force nfc pkoduring otherpk pastpk gof elections_mn 
stcox force nfc pkoduring otherpk pastpk gof elections_nelda 
esttab using rob5.csv 

use "LM_Intervention_Replication/Matching Analysis/peace_post_match_FORCE2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)

eststo clear
stcox force nfc pkoduring otherpk pastpk gof elections_mn 
stcox force nfc pkoduring otherpk pastpk gof elections_nelda 
esttab using rob6.csv 

use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NOFORCE.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)

eststo clear
stcox noforce nfc pkoduring otherpk pastpk gof elections_mn 
stcox noforce nfc pkoduring otherpk pastpk gof elections_nelda 
esttab using rob7.csv 

use "LM_Intervention_Replication/Matching Analysis/peace_post_match_NOFORCE2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)

stcox noforce nfc pkoduring otherpk pastpk gof elections_mn 
stcox noforce nfc pkoduring otherpk pastpk gof elections_nelda 
esttab using rob8.csv 

*2.0b: GOVERNANCE VARIABLES: USE MATCHED DATA IN "ROBUSTNESS CHECKS --> GOVERNANCE VARIABLES" FOLDER

*Military Coercion
use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/Governance Variables/peace_post_match_FORCE.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)

eststo clear
stcox force nfc lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp wgi_rol wgi_voa
esttab using rob15.csv 

use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/Governance Variables/peace_post_match_FORCE2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)

eststo clear
stcox force nfc lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp freepress
esttab using rob16.csv 

*No Coercion
use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/Governance Indicators/peace_post_match_NOFORCE.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)

eststo clear
eststo: quietly stcox noforce nfc lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp wgi_rol wgi_voa 
esttab using rob17.csv 

use "LM_Intervention_Replication/Matching Analysis/Governance Indicators/peace_post_match_NOFORCE.dta", clear 
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)

eststo clear
eststo: quietly stcox noforce nfc lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp  freepress
esttab using rob18.csv 

*CI
use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/Governance Variables/peace_post_match_NFC.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
 
eststo clear
eststo: stcox nfc force lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp wgi_rol wgi_voa
esttab using rob11.csv

use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/Governance Variables/peace_post_match_NFC2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
 
eststo clear
eststo: stcox nfc force lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp freepress
esttab using rob12.csv

*No CI
use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/Governance Variables/peace_post_match_NONFC.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)

eststo clear
stcox nonfc force lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp wgi_rol wgi_voa
esttab using rob13.csv 

use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/Governance Variables/peace_post_match_NONFC2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)

eststo clear
stcox nonfc force lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp freepress
esttab using rob14.csv 

*2.0C: FOR EACH ROBUSTNESS CHECK USE THE DATA IN FOLDERS FOR EACH ONE IN "MATCHING ANALYSIS --> ROBUSTNESS CHECKS"

*APPENDIX 2.1: WITHIN-PKO MATCHING**

*Military Coercion
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WIFORCE.dta", clear
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WIFORCE2.dta", clear

rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox force  

*No Coercion
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WINOFORCE.dta", clear
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WINOFORCE2.dta", clear

rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox noforce  

*CI
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WINFC.dta", clear
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WINFC2.dta", clear

rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox nfc    

* No CI
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WINONFC.dta", clear
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WINONFC2.dta", clear

rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox nonfc   
clear

* CI, FORCE
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WINFCforce.dta", clear
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WINFCforce2.dta", clear
logit X_d forcenfc

* CI, NO FORCE
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WINFCnoforce.dta", clear
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WINFCnoforce2.dta", clear
logit X_d noforcenfc

* No CI, FORCE
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WINONFCforce.dta", clear
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WINONFCforce2.dta", clear
logit X_d forcenonfc 

*  NO CI, NO FORCE
us "LM_Intervention_Replication/Matching Analysis/peace_post_match_WINONFCnoforce.dta", clear
use "LM_Intervention_Replication/Matching Analysis/peace_post_match_WINONFCnoforce2.dta", clear
logit X_d noforcenonfc 

**2.2: PEACE PERIODS WITH PEACE AGREEMENTS ONLY**
use "LM_Intervention_Replication/ML_peaceperiods_pre-match", clear
tab _d UN if pa == 1, column miss chi2 exact
tab _d UN if pa == 0, column miss chi2 exact

*MATCHING (USE THE FOLDER "ROBUSTNESS CHECKS --> PA")
*All UN
use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/PA/peace_post_match_ANYUN.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox UN lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 eeurop asia lamerica ssafrica nafrme 

use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/PA/peace_post_match_ANYUN2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox UN lwdeaths lwdurat ethfrac pop lmtnest milper bwgdp bwplty2 eeurop asia lamerica ssafrica nafrme 

*Military Coercion
use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/PA/peace_post_match_FORCE.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox force 

use "LM_Intervention_Replication/Matching Analysis/Robustness Checks//PA/peace_post_match_FORCE2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox force 

*No Military Coercion
use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/PA/peace_post_match_NOFORCE.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox noforce 

use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/PA/peace_post_match_NOFORCE2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox noforce   

*  CI
use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/PA/peace_post_match_NFC.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox nfc 

use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/PA/peace_post_match_NFC2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox nfc  

* NO CI
use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/PA/peace_post_match_NONFC.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox nonfc 

use "LM_Intervention_Replication/Matching Analysis/Robustness Checks/PA/peace_post_match_NONFC2.dta", clear
rename X_t0 t0
rename X_t t
rename X_d d
stset t, failure(d)
stcox nonfc 
